import Vue from 'vue'
import VueRouter from 'vue-router'
// 路径里写@ -> webpack内置路径变量 (它代表src文件夹的绝对地址)
import Layout from '@/views/Layout'
import Home from '@/views/Home'
import Search from '@/views/Search'
// import Play from '@/views/Play'
Vue.use(VueRouter)
const routes = [
    {
        path: '/',
        redirect: '/layout'
    },
    {
        path: '/layout',
        component: Layout,
        redirect: '/layout/home',
        children: [
            {
                path: 'home',
                component: Home,
                meta: { // 固定内置的-路由对象(路由页面, 绑定额外的数据)
                    title: '首页'
                }
            },
            {
                path: 'search',
                component: Search,
                meta: {
                    title: '搜索'
                }
            },
        ]
    },
    // {
    //     path: '/play',
    //     component: Play
    // }
]
const router = new VueRouter({
    routes
})
export default router
